package com.tcode.springjpa.dao;

import com.tcode.springjpa.bean.Userbean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Optional;

public interface UserDao extends JpaRepository <Userbean,Integer>{
    @Transactional
    @Modifying
    @Query(value="update Userbean set uname =:name,phone=:phone where uid =:id ")
    void modUser(@Param("name") String name,@Param("phone") String phone,
                 @Param("id") Integer id);
}
